//
//  CFrameHelper.m
//  BZBN
//
//  Created by chen on 2017/8/5.
//  Copyright © 2017年 KuoShuChing. All rights reserved.
//

#import "CFrameHelper.h"

@implementation CFrameHelper

+ (CGFloat)getSingleLineLabelWidth:(UILabel *)label maxWidth:(CGFloat)maxWidth {
    CGRect rect = [label.text boundingRectWithSize:CGSizeMake(maxWidth, label.height) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : label.font} context:nil];
    return rect.size.width;
}

+ (CGRect)getMoreLineLabelRect:(UILabel *)label maxWidth:(CGFloat)maxWidth maxHeight:(CGFloat)maxHeight {
    CGRect rect = [label.text boundingRectWithSize:CGSizeMake(maxWidth, maxHeight) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName : label.font} context:nil];
    return rect;
}
@end
